gtk/treeview: Position editable widgets correctly wrt left border
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 11 Dec 2020 16:56:14 +0000 (17:56 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 12 Dec 2020 00:42:42 +0000 (01:42 +0100)
The coordinates are already widget-local here, not transformed by the
adjustment positions. Using the adjustment value here ends up pushing
the entry far from the left border.

The correct minimum value here is 0, which matches the treeview left
border.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3009
gtk/gtktreeview.c

index dda21f82aae46909c5f62c85b6157bd4c6e0141d..82d5fd97d87225f813c70d35ac3416900d9b8cdb 100644 (file)
@@ -2627,10 +2627,10 @@ gtk_tree_view_size_allocate (GtkWidget *widget,
        * preferring the top left corner (for RTL)
        * or top right corner (for LTR)
        */
-      min_x = gtk_adjustment_get_value (priv->hadjustment);
+      min_x = 0;
       max_x = min_x + width - child_rect.width;
       min_y = 0;
-        max_y = min_y + height - gtk_tree_view_get_effective_header_height (tree_view) - child_rect.height;
+      max_y = min_y + height - gtk_tree_view_get_effective_header_height (tree_view) - child_rect.height;
 
       if (direction == GTK_TEXT_DIR_LTR)
         /* Ensure that child's right edge is not sticking to the right